<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>5.7 单体内置对象</title>
    <script>
        let url = 'http://www.xxmi.cn/main index.html?name=张三 李四&address=重庆市 沙坪坝 下中渡口';
        let encodeUrl1 = encodeURI(url);
        let encodeUrl2 = encodeURIComponent(url);
        console.log(encodeUrl1);
        console.log(encodeUrl2);
        console.log(decodeURI(encodeUrl1));
        console.log(decodeURIComponent(encodeUrl2));
    </script>
</head>
<body>

</body>
</html>